removed usage of deprecated -m flag in dbt#2000
Conversation
WalkthroughRemoved the models argument from CommandLineDbtRunner.run and its command construction. Updated DataMonitoringAlerts to pass select instead of models when invoking dbt run for alerts_v2. No other logic paths changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Scheduler as Scheduler/Caller
participant Alerts as DataMonitoringAlerts
participant DbtRunner as CommandLineDbtRunner
participant dbt as dbt CLI
Scheduler->>Alerts: _populate_data()
Alerts->>DbtRunner: run(select="elementary_cli.alerts.alerts_v2", full_refresh?, vars?)
note over Alerts,DbtRunner: Parameter changed from models → select
DbtRunner->>dbt: dbt run --select=<value> [--full-refresh] [--vars ...]
dbt-->>DbtRunner: exit code / output
DbtRunner-->>Alerts: success/failure
Alerts-->>Scheduler: return
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
👋 @ofek1weiss |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
elementary/monitor/data_monitoring/alerts/data_monitoring_alerts.py (2)
105-113: Nit: avoid shadowing the built-in namevarsMinor readability/pitfall. Rename the local
varsto avoid shadowing Python’s built-in function.- vars = dbt_vars or dict() - if days_back: - vars.update(days_back=days_back) + dbt_vars_resolved = (dbt_vars or {}).copy() + if days_back: + dbt_vars_resolved["days_back"] = days_back success = self.internal_dbt_runner.run( select="elementary_cli.alerts.alerts_v2", full_refresh=dbt_full_refresh, - vars=vars, + vars=dbt_vars_resolved, )
391-401: Typo:popopulated_data_successfully→populated_data_successfullyCosmetic but noisy for readers and tooling.
- popopulated_data_successfully = self._populate_data( + populated_data_successfully = self._populate_data( days_back=days_back, dbt_full_refresh=dbt_full_refresh, dbt_vars=dbt_vars, ) - if not popopulated_data_successfully: + if not populated_data_successfully: self.success = False
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
elementary/clients/dbt/command_line_dbt_runner.py(0 hunks)elementary/monitor/data_monitoring/alerts/data_monitoring_alerts.py(1 hunks)
💤 Files with no reviewable changes (1)
- elementary/clients/dbt/command_line_dbt_runner.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: test / test
- GitHub Check: code-quality
🔇 Additional comments (2)
elementary/monitor/data_monitoring/alerts/data_monitoring_alerts.py (2)
109-113: LGTM: switch from models→select aligns with dbt deprecationUsing select="elementary_cli.alerts.alerts_v2" matches the updated CommandLineDbtRunner.run signature and the dbt -s flag. No functional regressions apparent.
109-113: No remaining dbt-morrun(models=…)usage
Verified no occurrences in code or CI scripts; the only-mflags found in docs are standard Python module invocations (e.g.,python3 -m venv,python3 -m pip install), not dbt commands.
the
-mflag was deprecated in favor of-sin 2021https://docs.getdbt.com/reference/deprecations#modelparamusagedeprecation
removed its usage in the project
Summary by CodeRabbit